<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>Flask介绍 | 课程简介</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="gitbook/style.css">
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="./C01-CreateProject/index.html" />
    
    
    <link rel="prev" href="./index.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="1"
        data-chapter-title="Flask介绍"
        data-filepath="AboutFlask.md"
        data-basepath="."
        data-revision="Sat May 11 2019 20:06:35 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="./index.html">
                
                        <i class="fa fa-check"></i>
                        
                        课程简介
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="1" data-path="AboutFlask.html">
            
                
                    <a href="./AboutFlask.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Flask介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="C01-CreateProject/index.html">
            
                
                    <a href="./C01-CreateProject/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        工程搭建
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="C01-CreateProject/EnvInstall.html">
            
                
                    <a href="./C01-CreateProject/EnvInstall.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        环境安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="C01-CreateProject/HelloWorld.html">
            
                
                    <a href="./C01-CreateProject/HelloWorld.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        HelloWorld程序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="C01-CreateProject/AboutParams.html">
            
                
                    <a href="./C01-CreateProject/AboutParams.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        参数说明
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="C01-CreateProject/StartDevelopmentServer.html">
            
                
                    <a href="./C01-CreateProject/StartDevelopmentServer.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        开发服务器运行方式
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="C02-RouterAndBlueprint/index.html">
            
                
                    <a href="./C02-RouterAndBlueprint/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        路由与蓝图
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="C02-RouterAndBlueprint/Router.html">
            
                
                    <a href="./C02-RouterAndBlueprint/Router.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        路由
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="C02-RouterAndBlueprint/Blueprint.html">
            
                
                    <a href="./C02-RouterAndBlueprint/Blueprint.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        蓝图
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="C03-RequestAndResponse/index.html">
            
                
                    <a href="./C03-RequestAndResponse/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        请求与响应
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="C03-RequestAndResponse/HandleRequest.html">
            
                
                    <a href="./C03-RequestAndResponse/HandleRequest.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        处理请求
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="C03-RequestAndResponse/HandleResponse.html">
            
                
                    <a href="./C03-RequestAndResponse/HandleResponse.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        处理响应
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="C03-RequestAndResponse/CookieAndSession.html">
            
                
                    <a href="./C03-RequestAndResponse/CookieAndSession.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        Cookie与Session
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="C04-HookAndContext/index.html">
            
                
                    <a href="./C04-HookAndContext/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        请求钩子与上下文
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="C04-HookAndContext/AbortAndErrorhandler.html">
            
                
                    <a href="./C04-HookAndContext/AbortAndErrorhandler.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        异常处理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="C04-HookAndContext/Hook.html">
            
                
                    <a href="./C04-HookAndContext/Hook.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        请求钩子
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="C04-HookAndContext/Context.html">
            
                
                    <a href="./C04-HookAndContext/Context.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        上下文
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="C05-Flask-RESTful/index.html">
            
                
                    <a href="./C05-Flask-RESTful/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        Flask-RESTful
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="C05-Flask-RESTful/QuickStart.html">
            
                
                    <a href="./C05-Flask-RESTful/QuickStart.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        起步
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="C05-Flask-RESTful/AboutView.html">
            
                
                    <a href="./C05-Flask-RESTful/AboutView.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        关于视图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="C05-Flask-RESTful/AboutRequest.html">
            
                
                    <a href="./C05-Flask-RESTful/AboutRequest.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        关于请求
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="C05-Flask-RESTful/AboutResponse.html">
            
                
                    <a href="./C05-Flask-RESTful/AboutResponse.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        关于响应
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="./" >课程简介</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="flask&#x4ECB;&#x7ECD;">Flask&#x4ECB;&#x7ECD;</h1>
<h2 id="1-&#x5B66;&#x4E60;flask&#x6846;&#x67B6;&#x7684;&#x539F;&#x56E0;">1 &#x5B66;&#x4E60;Flask&#x6846;&#x67B6;&#x7684;&#x539F;&#x56E0;</h2>
<p><img src="images/2018&#x5E74;Web&#x6846;&#x67B6;&#x5360;&#x6BD4;.png" alt="&#x6846;&#x67B6;&#x5360;&#x6BD4;"></p>
<p>2018 Python&#x5B98;&#x65B9;&#x5E74;&#x5EA6;&#x8C03;&#x7814;&#x62A5;&#x544A;&#x663E;&#x793A;Flask&#x4E0E;Django&#x4E3A;Python Web&#x5F00;&#x53D1;&#x4F7F;&#x7528;&#x6700;&#x4E3B;&#x8981;&#x7684;&#x4E24;&#x4E2A;&#x6846;&#x67B6;&#x3002;</p>
<h2 id="2-flask">2 Flask</h2>
<p><img src="images/flask.png" alt="flask"></p>
<p>Flask&#x8BDE;&#x751F;&#x4E8E;2010&#x5E74;&#xFF0C;&#x662F;Armin ronacher&#xFF08;&#x4EBA;&#x540D;&#xFF09;&#x7528; Python &#x8BED;&#x8A00;&#x57FA;&#x4E8E; Werkzeug &#x5DE5;&#x5177;&#x7BB1;&#x7F16;&#x5199;&#x7684;&#x8F7B;&#x91CF;&#x7EA7;Web&#x5F00;&#x53D1;&#x6846;&#x67B6;&#x3002;</p>
<p>Flask &#x672C;&#x8EAB;&#x76F8;&#x5F53;&#x4E8E;&#x4E00;&#x4E2A;&#x5185;&#x6838;&#xFF0C;&#x5176;&#x4ED6;&#x51E0;&#x4E4E;&#x6240;&#x6709;&#x7684;&#x529F;&#x80FD;&#x90FD;&#x8981;&#x7528;&#x5230;&#x6269;&#x5C55;&#xFF08;&#x90AE;&#x4EF6;&#x6269;&#x5C55;Flask-Mail&#xFF0C;&#x7528;&#x6237;&#x8BA4;&#x8BC1;Flask-Login&#xFF0C;&#x6570;&#x636E;&#x5E93;Flask-SQLAlchemy&#xFF09;&#xFF0C;&#x90FD;&#x9700;&#x8981;&#x7528;&#x7B2C;&#x4E09;&#x65B9;&#x7684;&#x6269;&#x5C55;&#x6765;&#x5B9E;&#x73B0;&#x3002;&#x6BD4;&#x5982;&#x53EF;&#x4EE5;&#x7528; Flask &#x6269;&#x5C55;&#x52A0;&#x5165;ORM&#x3001;&#x7A97;&#x4F53;&#x9A8C;&#x8BC1;&#x5DE5;&#x5177;&#xFF0C;&#x6587;&#x4EF6;&#x4E0A;&#x4F20;&#x3001;&#x8EAB;&#x4EFD;&#x9A8C;&#x8BC1;&#x7B49;&#x3002;Flask &#x6CA1;&#x6709;&#x9ED8;&#x8BA4;&#x4F7F;&#x7528;&#x7684;&#x6570;&#x636E;&#x5E93;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x9009;&#x62E9; MySQL&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x7528; NoSQL&#x3002;</p>
<p>&#x5176; WSGI &#x5DE5;&#x5177;&#x7BB1;&#x91C7;&#x7528; Werkzeug&#xFF08;&#x8DEF;&#x7531;&#x6A21;&#x5757;&#xFF09;&#xFF0C;&#x6A21;&#x677F;&#x5F15;&#x64CE;&#x5219;&#x4F7F;&#x7528; Jinja2&#x3002;&#x8FD9;&#x4E24;&#x4E2A;&#x4E5F;&#x662F; Flask &#x6846;&#x67B6;&#x7684;&#x6838;&#x5FC3;&#x3002;</p>
<p><strong>&#x6700;&#x65B0;&#x7248;&#x672C; 1.0.2</strong></p>
<h2 id="3-&#x6846;&#x67B6;&#x5BF9;&#x6BD4;">3 &#x6846;&#x67B6;&#x5BF9;&#x6BD4;</h2>
<h4 id="1&#xFF09;-&#x6846;&#x67B6;&#x8F7B;&#x91CD;">1&#xFF09; &#x6846;&#x67B6;&#x8F7B;&#x91CD;</h4>
<p>&#x91CD;&#x91CF;&#x7EA7;&#x7684;&#x6846;&#x67B6;&#xFF1A;&#x4E3A;&#x65B9;&#x4FBF;&#x4E1A;&#x52A1;&#x7A0B;&#x5E8F;&#x7684;&#x5F00;&#x53D1;&#xFF0C;&#x63D0;&#x4F9B;&#x4E86;&#x4E30;&#x5BCC;&#x7684;&#x5DE5;&#x5177;&#x3001;&#x7EC4;&#x4EF6;&#xFF0C;&#x5982;Django</p>
<p>&#x8F7B;&#x91CF;&#x7EA7;&#x7684;&#x6846;&#x67B6;&#xFF1A;&#x53EA;&#x63D0;&#x4F9B;Web&#x6846;&#x67B6;&#x7684;&#x6838;&#x5FC3;&#x529F;&#x80FD;&#xFF0C;&#x81EA;&#x7531;&#x3001;&#x7075;&#x6D3B;&#x3001;&#x9AD8;&#x5EA6;&#x5B9A;&#x5236;&#xFF0C;&#x5982;Flask&#x3001;Tornado</p>
<h4 id="2&#xFF09;&#x4E0E;django&#x5BF9;&#x6BD4;">2&#xFF09;&#x4E0E;Django&#x5BF9;&#x6BD4;</h4>
<p>django&#x63D0;&#x4F9B;&#x4E86;&#xFF1A;</p>
<p>django-admin&#x5FEB;&#x901F;&#x521B;&#x5EFA;&#x9879;&#x76EE;&#x5DE5;&#x7A0B;&#x76EE;&#x5F55;</p>
<p>manage.py &#x7BA1;&#x7406;&#x9879;&#x76EE;&#x5DE5;&#x7A0B;</p>
<p>orm&#x6A21;&#x578B;&#xFF08;&#x6570;&#x636E;&#x5E93;&#x62BD;&#x8C61;&#x5C42;&#xFF09;</p>
<p>admin&#x540E;&#x53F0;&#x7BA1;&#x7406;&#x7AD9;&#x70B9;</p>
<p>&#x7F13;&#x5B58;&#x673A;&#x5236;</p>
<p>&#x6587;&#x4EF6;&#x5B58;&#x50A8;&#x7CFB;&#x7EDF;</p>
<p>&#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x7CFB;&#x7EDF;</p>
<p>&#x800C;&#x8FD9;&#x4E9B;&#xFF0C;flask&#x90FD;&#x6CA1;&#x6709;&#xFF0C;&#x90FD;&#x9700;&#x8981;&#x6269;&#x5C55;&#x5305;&#x6765;&#x63D0;&#x4F9B;</p>
<h2 id="4-&#x5E38;&#x7528;&#x6269;&#x5C55;&#x5305;">4 &#x5E38;&#x7528;&#x6269;&#x5C55;&#x5305;</h2>
<p>&#x6269;&#x5C55;&#x5217;&#x8868;&#xFF1A;<a href="http://flask.pocoo.org/extensions/" target="_blank">http://flask.pocoo.org/extensions/</a></p>
<ul>
<li>Flask-SQLalchemy&#xFF1A;&#x64CD;&#x4F5C;&#x6570;&#x636E;&#x5E93;&#xFF1B;</li>
<li>Flask-script&#xFF1A;&#x63D2;&#x5165;&#x811A;&#x672C;&#xFF1B;</li>
<li>Flask-migrate&#xFF1A;&#x7BA1;&#x7406;&#x8FC1;&#x79FB;&#x6570;&#x636E;&#x5E93;&#xFF1B;</li>
<li>Flask-Session&#xFF1A;Session&#x5B58;&#x50A8;&#x65B9;&#x5F0F;&#x6307;&#x5B9A;&#xFF1B;</li>
<li>Flask-WTF&#xFF1A;&#x8868;&#x5355;&#xFF1B;</li>
<li>Flask-Mail&#xFF1A;&#x90AE;&#x4EF6;&#xFF1B;</li>
<li>Flask-Bable&#xFF1A;&#x63D0;&#x4F9B;&#x56FD;&#x9645;&#x5316;&#x548C;&#x672C;&#x5730;&#x5316;&#x652F;&#x6301;&#xFF0C;&#x7FFB;&#x8BD1;&#xFF1B;</li>
<li>Flask-Login&#xFF1A;&#x8BA4;&#x8BC1;&#x7528;&#x6237;&#x72B6;&#x6001;&#xFF1B;</li>
<li>Flask-OpenID&#xFF1A;&#x8BA4;&#x8BC1;&#xFF1B;</li>
<li><strong>Flask-RESTful&#xFF1A;&#x5F00;&#x53D1;REST API&#x7684;&#x5DE5;&#x5177;&#xFF1B;</strong></li>
<li>Flask-Bootstrap&#xFF1A;&#x96C6;&#x6210;&#x524D;&#x7AEF;Twitter Bootstrap&#x6846;&#x67B6;&#xFF1B;</li>
<li>Flask-Moment&#xFF1A;&#x672C;&#x5730;&#x5316;&#x65E5;&#x671F;&#x548C;&#x65F6;&#x95F4;&#xFF1B;</li>
<li>Flask-Admin&#xFF1A;&#x7B80;&#x5355;&#x800C;&#x53EF;&#x6269;&#x5C55;&#x7684;&#x7BA1;&#x7406;&#x63A5;&#x53E3;&#x7684;&#x6846;&#x67B6;</li>
</ul>
<h2 id="5-flask&#x6587;&#x6863;">5 Flask&#x6587;&#x6863;</h2>
<ol>
<li>&#x4E2D;&#x6587;&#x6587;&#x6863;&#xFF08;<a href="http://docs.jinkan.org/docs/flask/" target="_blank">http://docs.jinkan.org/docs/flask/</a>&#xFF09;</li>
<li>&#x82F1;&#x6587;&#x6587;&#x6863;&#xFF08;<a href="http://flask.pocoo.org/docs/1.0/" target="_blank">http://flask.pocoo.org/docs/1.0/</a>&#xFF09;</li>
</ol>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="./index.html" class="navigation navigation-prev " aria-label="Previous page: 课程简介"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="./C01-CreateProject/index.html" class="navigation navigation-next " aria-label="Next page: 工程搭建"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="gitbook/app.js"></script>

    
    <script src="gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
